﻿CREATE TABLE [dbo].[Employee] (
    [id]              INT              IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
    [UserName]        NVARCHAR (50)    NULL,
    [EName]           NVARCHAR (20)    NULL,
    [Enumber]         NVARCHAR (20)    CONSTRAINT [DF_Employee_Enumber] DEFAULT ((9)) NULL,
    [ETempNumber]     NVARCHAR (20)    NULL,
    [Sex]             NVARCHAR (10)    NULL,
    [CompanyId]       INT              NULL,
    [DepartmentId]    NVARCHAR (50)    CONSTRAINT [DF_Employee_DepartmentId] DEFAULT ((0)) NULL,
    [PostCategory]    INT              CONSTRAINT [DF_Employee_PostCategory] DEFAULT ((0)) NULL,
    [PostId]          INT              CONSTRAINT [DF_Employee_PostId] DEFAULT ((0)) NULL,
    [State]           INT              CONSTRAINT [DF_Employee_State] DEFAULT ((0)) NULL,
    [RuzhiDate]       DATETIME         NULL,
    [ProbationFrom]   DATETIME         NULL,
    [ProbationTo]     DATETIME         NULL,
    [ZzDate]          DATETIME         NULL,
    [LizhiDate]       DATETIME         NULL,
    [Birthday]        NVARCHAR (20)    NULL,
    [Rtx]             NVARCHAR (20)    NULL,
    [OfficePhone]     NVARCHAR (30)    NULL,
    [HomePhone]       NVARCHAR (30)    NULL,
    [MobilePhone]     NVARCHAR (30)    NULL,
    [Email]           NVARCHAR (30)    NULL,
    [IDcard]          NVARCHAR (30)    NULL,
    [Address]         NVARCHAR (200)   NULL,
    [Education]       NVARCHAR (30)    NULL,
    [WorkYM]          NVARCHAR (50)    NULL,
    [Marriage]        NVARCHAR (50)    NULL,
    [PoliticsStatus]  NVARCHAR (50)    NULL,
    [Cuenta]          NVARCHAR (50)    NULL,
    [HeadPic]         NVARCHAR (50)    CONSTRAINT [DF_Employee_HeadPic] DEFAULT (N'/Content/userfiles/temp/headpic.jpg''') NULL,
    [GradeId]         INT              CONSTRAINT [DF_Employee_GradeId] DEFAULT ((0)) NULL,
    [WageNumber]      NVARCHAR (50)    NULL,
    [WageCardNo]      NVARCHAR (50)    NULL,
    [Pluralist]       NVARCHAR (50)    NULL,
    [UpName]          NVARCHAR (20)    NULL,
    [UpTime]          DATETIME         NULL,
    [ZhiWu]           NVARCHAR (50)    NULL,
    [IsTxlz]          BIT              CONSTRAINT [DF_Employee_IsTxlz] DEFAULT ((0)) NULL,
    [Pid]             INT              CONSTRAINT [DF_Employee_Pid] DEFAULT ((0)) NULL,
    [Cid]             INT              CONSTRAINT [DF_Employee_Cid] DEFAULT ((0)) NULL,
    [IsInsured]       INT              CONSTRAINT [DF_Employee_IsInsured_1] DEFAULT ((2)) NULL,
    [OldEName]        NVARCHAR (20)    NULL,
    [Nation]          NVARCHAR (10)    NULL,
    [ShenGao]         NVARCHAR (20)    NULL,
    [BloodType]       NVARCHAR (10)    NULL,
    [YXZY]            NVARCHAR (50)    NULL,
    [SkillName]       NVARCHAR (50)    NULL,
    [NativePlace]     NVARCHAR (50)    NULL,
    [QQ]              NVARCHAR (50)    NULL,
    [ForeignLanguage] NVARCHAR (50)    NULL,
    [DriveType]       NVARCHAR (50)    NULL,
    [Hobby]           NVARCHAR (50)    NULL,
    [XZJB]            NVARCHAR (50)    CONSTRAINT [DF_Employee_XZJB] DEFAULT (N'无') NULL,
    [IsCore]          BIT              CONSTRAINT [DF_Employee_IsCore] DEFAULT ((0)) NULL,
    [GID]             UNIQUEIDENTIFIER CONSTRAINT [DF_Employee_GID_1] DEFAULT (newid()) NULL,
    [ContractEndDate] DATETIME         NULL,
    [ZhiWuId]         INT              NULL,
    CONSTRAINT [PK_Employee] PRIMARY KEY CLUSTERED ([id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_CompanyId]
    ON [dbo].[Employee]([CompanyId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_DeptID]
    ON [dbo].[Employee]([DepartmentId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_EName]
    ON [dbo].[Employee]([EName] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_PostCategory]
    ON [dbo].[Employee]([PostCategory] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_PostId]
    ON [dbo].[Employee]([PostId] ASC);


GO
CREATE NONCLUSTERED INDEX [IX_Employee_State]
    ON [dbo].[Employee]([State] ASC);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Employee_826ee0dc990d48448c8b95f2db58c357]
    ON [dbo].[Employee]([UserName] ASC);


GO
CREATE NONCLUSTERED INDEX [EFS_IX_Employee_f235fe0f680744aebe04fde37d8473f7]
    ON [dbo].[Employee]([UserName] ASC, [State] ASC);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'兼职情况', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee', @level2type = N'COLUMN', @level2name = N'Pluralist';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否参保  0已参保  1 未参保', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee', @level2type = N'COLUMN', @level2name = N'IsInsured';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'是否核心人员', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'Employee', @level2type = N'COLUMN', @level2name = N'IsCore';

